export default {
  data() {
    return {};
  },
  methods: {
    getClientWidth() {
      const width = document.body.clientWidth;
      if (width < 992) {
        this.clientWidth = 'sm';
      }
      if (width >= 992 && width < 1200) {
        this.clientWidth = 'md';
      }
      if (width >= 1200 && width < 1920) {
        this.clientWidth = 'lg';
      }
      if (width >= 1200 && width < 1920) {
        this.clientWidth = 'lg';
      }
      if (width >= 1920) {
        this.clientWidth = 'xl';
      }
    },
    getChartParams(length) {
      if (this.clientWidth === 'sm') {
        this.dataZoomShow = length >= 6 ? true : false;
        if (length < 6) {
          this.dataZoomEnd = 100;
        } else if (length >= 6 && length < 10) {
          this.dataZoomEnd = 90;
        } else if (length >= 10 && length < 14) {
          this.dataZoomEnd = 80;
        } else if (length >= 14) {
          this.dataZoomEnd = 75;
        }
      }
      if (this.clientWidth === 'md') {
        this.dataZoomShow = length >= 8 ? true : false;
        if (length < 6) {
          this.dataZoomEnd = 100;
        } else if (length >= 6 && length < 10) {
          this.dataZoomEnd = 80;
        } else if (length >= 10 && length < 14) {
          this.dataZoomEnd = 70;
        } else if (length >= 14) {
          this.dataZoomEnd = 60;
        }
      }
      if (this.clientWidth === 'lg') {
        this.dataZoomShow = length >= 10 ? true : false;
        if (length < 14) {
          this.dataZoomEnd = 100;
        } else if (length >= 14) {
          this.dataZoomEnd = 80;
        }
      }
      if (this.clientWidth === 'xl') {
        this.dataZoomShow = length >= 12 ? true : false;
        if (length < 14) {
          this.dataZoomEnd = 100;
        } else if (length >= 14) {
          this.dataZoomEnd = 80;
        }
      }
    }
  }
};
